/**
 * @author LKQ
 * @date 2021/12/17 21:41
 * @description
 */
public class Solution {
    public static void main(String[] args) {
        Solution solution = new Solution();
        solution.titleToNumber("FXSHRXW");
    }

    public int titleToNumber(String columnTitle) {
        int ans = 0, n = columnTitle.length();
        for (int i = 0; i < n; i++) {
            ans += (columnTitle.charAt(i) - 64) * Math.pow(26, n-i-1);
        }
        return ans;
    }
}
